/*
 * @Description:
 * @Version: 2.0
 * @Autor: wsh
 * @Date: 2023-06-20 18:20:38
 * @LastEditors: uphldjx 1373577124@qq.com
 * @LastEditTime: 2024-07-25 15:21:15
 */
// 列表
const tableConfig = {
	stripe: true,
	border: true,
	maxHeight: '80vh',
	columns: [
		{ label: '养老机构', prop: 'organizationName' },
		{ label: '姓名', prop: 'personName' },
		{ label: '身份证号', prop: 'idCard' },
		{ label: '类型', prop: 'personTypeLabel' },
		{ label: '打卡方式', prop: 'punchTypeLabel' },
		{ label: '打卡时间', prop: 'punchTime' },
		{ label: '打卡地点', prop: 'punchPlace' },
		{ label: '打卡图片', prop: 'punchImg', custome: 'img' },
		{
			label: '操作',
			prop: 'menu',
			width: 300,
			fixed: 'right',
		},
	],
}

// 详情
export const detailConfig = {
	inline: false,
	showBtn: false,
	labelPosition: 'left',
	column: [
		{ label: '养老机构', prop: 'organizationName', span: 8 },
		{ label: '姓名', prop: 'personName', span: 8 },
		{ label: '身份证号', prop: 'idCard', span: 8 },
		{ label: '类型', prop: 'personTypeLabel', span: 8 },
		{ label: '能力等级', prop: 'levelLabel', span: 8 },
		{ label: '打卡方式', prop: 'punchTypeLabel', span: 8 },
		{ label: '打卡时间', prop: 'punchTime', span: 8 },
		{ label: '打卡地点', prop: 'punchPlace', span: 8 },
		{ label: '打卡图片', prop: 'punchImg', span: 8, custome: 'img' },
	],
}

export const baseConfig = {
	pageName: '机构打卡管理',
	// 数据字典
	dictcodes: ['PUNCH_TYPE', 'LEVEL'],
	rowKey: 'idCard',
	api: {
		index: 'view_dpOrgPunchRecord_page',
	},
	auth: {
		index: 'view_dpOrgPunchRecord_page',
		// 批量搜索
		mulitSet: 'mulitSet',
	},
	// 当前行操作按钮
	menuBtn: [
		{
			icon: 'detail',
			label: '查看',
			type: 'primary',
			operate: 'detail',
			auth: 'view_dpOrgPunchRecord_page',
			text: true,
			show: true,
		},
	],
	dialogConfig: {
		width: '80%',
	},
	// 搜索
	searchConfig: {
		inline: true,
		showBtn: true,
		labelPosition: 'left',
		column: [
			{ label: '养老机构', prop: 'organizationName', span: 8 },
			{ label: '姓名', prop: 'personName', span: 8 },
			{ label: '身份证号', prop: 'idCard', span: 8 },
			{
				label: '类型',
				prop: 'personType',
				type: 'select',
				dicData: [
					{ label: '老人', value: 1 },
					{ label: '员工', value: 2 },
				],
				span: 8,
			},
			{
				label: '打卡方式',
				prop: 'punchType',
				propName: 'punchTypeLabel',
				type: 'remoteSelect',
				code: 'PUNCH_TYPE',
				api: 'getDictItemList',
				filterKey: 'value',
				multiple: false,
				span: 8,
			},
		],
	},
	// 列表
	tableConfig,
	// 详情
	detailConfig,
	beforeOnLoadFormate: (query) => {
		console.log(query, 'beforeOnLoadFormate')
		return new Promise((resolve, reject) => {
			console.log(query, 'Promise')
			resolve({
				...query,
			})
		})
	},
}
